#define  _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>

int DF(int n, int m)
{
	int x = n ^ m;
	int count = 0;
	while (x)
	{
		x = x & (x - 1);
		count++;
	}
	return count;
}


int main()
{
	int n = 0;
	int m = 0;
	scanf("%d %d", &n,&m);
	int sum=DF(n,m);
	printf("%d", sum);
	return 0;
}